The heavy-equipment maker has struggled, but is now in position to perform well when its markets turn.