Earlier quoted context omitted.
You don't even have to do that. When you compile your binary you just need to set the rpath to your own directory of libs and they will be search automatically and fall back to the system if missing.
Last time I looked the rpath is a static absolute path, which is inconvenient if you want to install the libraries elsewhere. The automatic fallback to system libraries can also lead to mysterious problems.
${ORIGIN}/lib will be the relative library path.