First of all -- they did not say that. They spoke Latin: "Ave, Imperator, morituri te salutant". It's really important that you remember whenever you see what seems to be an anachronism in a translation of a Latin (or any other language) phrase that you're not reading the original words.
The word "salute" (and its older Latin root) refers to any greeting or sign of respect, not only to a specific motion of raising one's hand to one's temple. You can see this preserved in English in the word "salutation" and in the French informal greeting "salut".