High temperature resistant rare earth magnets