Suppose a U.S. citizen joined the military of a foreign power at war with the U.S. Would anyone question the legality of that citizen being shot in the pursuit of hostilities between the warring powers? Answer: no. Soldiers get shot in battle, everyone understands this.
Al Qaida has declared war upon the U.S. Anwar al-Awlaki, a U.S. citizen, is on record as having joined al Qaida and taken a leadership role therein. His status is identical to that of a U.S. citizen who has joined a enemy's army.
The U.S. has a long history of targeting specific high-value members of an enemy's military. An historic example is the P-38 mission to shoot down Japanese Admiral Isoroku Yamamoto over Bougainville, code named Operation Vengeance. The mission succeeded, the Admiral was killed.