Look for libpng16 and libpng17 when configuring PNG support.

diff --git a/configure b/configure
index 235a684..f484375 100755
--- a/configure
+++ b/configure
@@ -30705,7 +30705,7 @@
 
 
   if test $passed -gt 0; then
-    for var in 5 4 2 '' ; do
+    for var in 7 6 5 4 2 '' ; do
       if test "$have_png" = 'no' ; then
         if test "x${var}" = 'x' ; then
           pnglib='png'