A scheme to tailor its merchandise to the needs of local markets has helped lift sales and return US department store operator Macy's to a first-quarter profit.