Lennar swings to a year-end profit