Hi,
I'm not thinking about other packages provided by pkgsrc, but generally programs supplied with sourcecode.Riccardo, When other packages are compiled, I'm guessing that they use the pkg-config process. Your package probably installed a binary called libpng-config -- or likely libpng15-config. Doing things like "libpng-config --libs" will spit out the correct linking parameters for gcc, likewise for "libpng-config --cflags."
The code may include <libpng/png.h> and generally link with -lpng, configure will check for some locations but the structure is this usual one. NetBSD used to comply to this too by providing some links. I think it is a bug that the current libpng install is not done in this way anymore, but perhaps it was done with some good reason?
Riccardo