Here "Amalek" is a metonymy that refers to the people of Amalek. This continues Balaam's vision while turning to look in the direction of the Amalek nation, and then he prophecies about the Amalekites. (See: [[rc://en/ta/man/translate/figs-metonymy]])