Note, libpng requires the zlib library, therefore add --with-zlib-dir[ =DIR] to your configure line.
Enhance the capabilities of GD to handle more image formats by specifying the --with-XXXX configure switch to your PHP configure line.