I noticed a problem in configure since SVN-10626.
At the beginning I was thinking that it was caused by a problem with png on my system or with the png test which has been introduced in configure since that revision.
In fact the test was failing and I had to force png using -lpng in LDFLAGS.
Having some time to have a look at configure, it turned out it is caused by some bashisms.
In fact starting at line 7366 (SVN-10626), there are the following three lines:
CFLAGS+=" $LIBPNG_CFLAGS"
LDFLAGS+=" $LIBPNG_LDFLAGS"
LIBS+=" $LIBPNG_LIBS"
which don't work where /bin/sh as in the shebang is actually sh, and not bash.
This problem is still present in the last SVN revision I've downloaded, which is 10688.