Here is the legal memo from the Obama admin used to justify the al-Awlaki operation. A significant portion is spent arguing he was an "imminent threat"
It was a US drone and NATO forces that bombed Qaddafi's convoy and forced him into hiding until a mob found and killed him.