Macy’s, which has been struggling with weak sales, said Thursday that its longtime CEO Terry Lundgren will leave the job