Try exporting LD_LIBRARY_PATH.