I had exactly the same error, and it took me several hours to track down. The answer is that you need to make sure you're compiling the right version for your processor. In my case, I was not remembering that the PPC G5 is a 64-bit processor, and this was failing because I was using the 32-bit versions.
I also found it was helpful to change the two config lines to be more specific about setting things up for the PPC64 architecture, as follows
For jpeg-6b:
THE FOLLOWING LINE DOES NOT WORK PROPERLY:
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure --enable-shared
BUT THIS ONE DOES (ON THE G5 AT LEAST):
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=" -arch ppc64 -g -Os -pipe -no-cpp-precomp" CCFLAGS=" -arch ppc64 -g -Os -pipe" CXXFLAGS="-arch ppc64 -g -Os -pipe" LDFLAGS="-arch ppc64 -bind_at_load" ./configure --enable-shared
For GD:
THE FOLLOWING LINE DOES NOT WORK PROPERLY:
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6
BUT THIS ONE DOES (ON THE G5 AT LEAST):
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=" -arch ppc64 -g -Os -pipe -no-cpp-precomp" CCFLAGS=" -arch ppc64 -g -Os -pipe" CXXFLAGS="-arch ppc64 -g -Os -pipe" LDFLAGS=" -arch ppc64 -bind_at_load" ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6