my apologies. i figured this out finally just after posting.

the tip came from http://gcc.gnu.org/ml/gcc-help/2004-04/msg00106.html

all i had to do is change the order of the LIBS from APP.

Cheers,
Chas