Update to work with modern versions of libpng.

Per http://libpng.sourceforge.net/ANNOUNCE-1.4.0.txt, png_set_gray_1_2_4_to_8() was renamed.
Fix typo: add library flags from pkg-config to LDLIBS, not cflags