Considering that the President of the United States is the head of the military (General of Generals), he would be considered part of the military. Therefore he (though in civilian cloths) has the obligation to acknowledge the salute of those below him in the military
a hand salute would not be inappropriate. I dont believe that there are any guidelines against saluting while in civvies.
Besides, whats the big deal, the Pres. is only showing respect and acknowledgement for those in the military.
AND, as the head of the US Military, he can do as he wishes, and ignore established protocol if he wants (after all he is in charge).
As Vet myself, I always get somewhat of a thrill when he does return the salute.