rebuild the source code for this unknown application
and point gcc linker to the DIFFERENT libraries
for example i am debuging a CUSTOM build of the math program "octave"
it is using a CUSTOM built 32 bit floating point version of Imagemagick using DOUBLE precision floating point
so i build that program and install it OUT OF THE SYSTEM PATH!!!!!
( other programs NEED!!!! the 16 bit imagemagick that is installed by default )
and DO NOT!!!! add that location to the /etc/ld.so.conf
and do NOT add the include files location to the system
now for the math program "octave" that NEEDS the custom libraries
i pass that location to the compiler while building octave
--- then something like this
./configure --prefix= /opt/customProgram LDFLAGS=/opt/ImageMagick_Q32HDRI/lib CPPFLAGS=/opt/ImageMagick_Q32HDRI/include