It's already been pointed out many times that this isn't a configure problem. You can play with configure until the cows come home, but if the OS can't locate your dynamic library at runtime, your application will fail.

Put your library in the same directory as your executable as a first step. If that works, adjust your LD_LIBRARY_PATH to include your "standard" location. Better yet, install the library in some standard place where the dynamic linker already expects to find libraries, like /usr/lib or some other appropriate spot.

The linker is telling you everything you need to know: it doesn't know where your library is. You have to tell it.

If you're trying to build Qt using a different jpeg library than it was coded for, you're going to fail. No amount of linker magic can overcome a foreign API.