I've had the same problem before and I wish I had known about the --enable-share switch at the time.
As an extra workaround to this problem (which I didn't like doing, but hey, it worked) was just use the RPM that comes with the Linux distro (mine was whatever ships with Fedora Core 1).
On that Fedora Core 1 box (or whatever Linux you're using), check that the libjpeg RPM is already installed:
rpm -qa | grep libjpeg | sort
You'll get some returns if it's there. Then, since it's there, you don't have to uncompress and configure the libjeg tarball. When you do the ./configure for PHP, use this line for your switch:
./configure --with-jpeg \
(plus your other switches here)
By not specifying the directory to libjpeg (such as --with-jpeg=/usr/llocal/jpeg-6b), PHP will search for it and use what it finds. Maybe I am not explaining that 100% correctly, but you get my point.
However, I like this new way of solving the problem and PHPDev, thanks for posting. Otherwise, I would never have scanned this forum and seen this old post.
Especially thanks to michaelphipps for this solution as well.