Retailer Macy's returned to profit in the third quarter, boosted by a 6.6% revenue increase and a 3.9% rise in same store sales.