Job cuts announced by U.S.-based companies declined sharply in May as the energy sector laid off fewer workers.