Some versions of libpng bomb out on line 255 of pngconf.h. To fix this, remove the two invalid lines of code from /usr/local/include/pngconf.h.
Change this:
# ifdef _SETJMP_H # __png.h__ already includes setjmp.h; # __dont__ include it again.;
to this:
# ifdef _SETJMP_H
/* __png.h__ already includes setjmp.h;
__dont__ include it again.;*/
# endif