See pages 9-11 of this Westpoint study on AQ members from countries joining the fight in Iraq against the US military:
http://tarpley.net/docs/CTCForeignFighter.19.Dec07.pdf
Easten Libya accounts for many of these, and they have the highest per capita AQ fighters of any country. The LIFG (Libyian Islamic Fighting Group) is an official member of AQ. In fact, many high ranking members of AQ are LIFG.
I have not been able to find info that indicates Gaddafi has been involved in terrorism after denouncing it 4 or 5 years ago.
However, it does look like he was brutally repressing/fighting the LIFG. And AQ has recently called for his head. There are also reports that rebels leaders are confirmed members of the LIFG.
In short, while Khaddafy is no real friend of the West he is an enemy of the LIFG/AQ, and they want him overthrown. And given his opposition arose from East Libya, it's entirely possible we're helping the LIFG/AQ overthrow Qaddafi.
http://www.weeklystandard.com/blogs/libyan-terrorist-muammar-qaddafi_552474.html
http://www.frumforum.com/is-al-qaeda-gaining-the-upper-hand-in-libya
However, this is (somewhat) disputed by US officials who claim we have only verified "flickers" of AQ in Libya.
It also appears that by attacking him, we have pushed him into attacking back at us using terroristic means. This was entirely predictable, and brought upon us by our own actions. This also indictates that, regardless of words to the contrary, we will be taking him down.
http://www.businessinsider.com/qaddafi-terrorist-attacks-in-europe-2011-3
I still believe we haven't been the whole truth about why we are intervening, why we would want to.
Fern