Just grasping at straws here as I do feel he has never been taught proper manners and may have something physically wrong but...sometimes certain dogs especially un-socialized ones take offense to being petted above their head (moving your hand and arms above them) Sometimes Dog who don't appreciate it can get really upset with you if you continue to do it.
When you move to pet him are you making eye contact? If you are he could really be taking offense.
Like I said I figure it's a lack of proper training and health and age ( I figure I'll be pretty grumpy when I get old too), but this might help.