otool (darwin version of ldd) shows gnuplot is linked to both versions of libpng, the one which comes with OS X in /usr/X11/lib and the one I installed in /usr/local/lib

otool -L /usr/local/bin/gnuplot | grep png
/usr/X11/lib/libpng12.0.dylib (compatibility version 45.0.0, current version 45.0.0)
/usr/local/lib/libpng15.15.dylib (compatibility version 21.0.0, current version 21.0.0)

I tried numerous things to get gnuplot to build with only one library or the other, but nothing worked until I temporarily moved the libpng12-config file while I ran ./configure and built gnuplot.
I noticed ./configure was finding it due to these lines output by ./configure: