Hi,
this looks like how you configured php.
But I think Vincent was talking about how you edited the Makefile of the gd distribution before you compiled it.
You have to edit some lines in the gd Makefile before compiling the gd library.
Uncomment/modify the following lines to add jpeg support to the gd library:
#CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
#LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11
LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
There are some comments in the Makefile that explain how to do the modifications
Greetings,
T.