ELF file format has an RPATH section where it lists hardcoded paths to search for libraries
You can find the RPATH that an application has:
readelf -d app_name | grep RPATH
Hardcoding paths into an application is not very elegant. It is better to allow the Linux dynamic linker to locate the libraries for you.
Fedora has /etc/ld.so.conf.d/ which is a folder it searches for library paths. You can add foo-x86_64.conf, and inside put the library path, and ld will search that path whenever it needs to locate libfoo.so