try ld_library_path
#!/bin/bash
export CXXFLAGS="${CXXFLAGS} -I${PREFIX}/include"
-export LDFLAGS="${LDFLAGS} -Wl,-rpath,${PREFIX}/lib"
+export LDFLAGS="${LDFLAGS}"
+export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}"
autoreconf -i
mkdir build
