/usr/include/mysql/ is not where mysql is installed
it would be /usr .In the default location .
and why this ?
jpeg 6 should be in /usr/lib/libjpeg.so.62.0.0
it is installed by default
unless you ALSO have a second and different version also installed and in possible conflict with the rpm installed by default
the same goes for this
libpng is a default installed rpm
and is installed in /usr/lib/libpng.so.3.49.0
autotools should take care of almost all of the settings
all that should be needed is
/configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5 --with-mysql --with-apxs2 --with-gd --with-mysqli
but if you only run this
the auto testing will very likely set everything
read the configure output and or the "configure.log"
for a list of what IS tested for AND the default setting have a read through the "--help" output for THAT configure file
in the php source folder run