In src/pslib.c, the "png_set_gray_1_2_4_to_8" function must be renamed to "png_set_expand_gray_1_2_4_to_8" to be compatible with libpng 1.4.
It will compile without, but print out a compile warning about implicit declaration.
And then pslib will crash and burn at runtime :-/
The fix is trivial:
sed -i -e 's:png_set_gray_1_2_4_to_8:png_set_expand_gray_1_2_4_to_8:' src/pslib.c
Also I'd like to mention that renaming the function is perfectly compatible with libpng 1.2... so no #ifdef's are required.