add LD_LIBRARY_PATH to LPATH before calling ld.