I encountered the same problem, and I believe it is because jpeg-6b is built with a very old version of autotools (the jpeg-6b version dates back 1998 if the sourceforge page is correct).
In particular, the problem is the way it checks if gcc supports the -fPIC flag:
checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... no
And this is how they perform the check from config.log:
ltconfig:547: checking if gcc PIC flag -fPIC works ltconfig:548: gcc -c -fPIC -DPIC -I/local/include conftest.c 1>&5 conftest.c:1:0: warning: -fPIC ignored for target (all code is position independent) ^
Notice how gcc returns a warning, it probably returns exit code 1 which makes the check fail. And position-independent code is necessary for shared libraries, so this makes it think it can't make them, and it later outputs:
checking whether to build shared libraries... no
Compare that with libjpeg9, which I assume uses a more up-to-date version of autotools:
checking for gcc -std=gnu99 option to produce PIC... -DDLL_EXPORT -DPIC checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works... yes
And from config.log:
configure:10108: checking for gcc -std=gnu99 option to produce PIC configure:10115: result: -DDLL_EXPORT -DPIC configure:10123: checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works configure:10141: gcc -std=gnu99 -c -g -O2 -I/local/include -DDLL_EXPORT -DPIC -DPIC conftest.c >&5 configure:10145: $? = 0 configure:10158: result: yes
I eventually compiled libjpeg9 instead, but I think libjpeg6 might also be compilable if you can recreate the ./configure script using a newer version of autotools.