configure: error: libpng.so not found

Please do the following.

cd /usr/local/src
wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.26.tar.gz?download
cd libpng-1.2.26

./configure
make
make install