$NetBSD$ pkg-config will take care with version id like: -lpng15 And simply -lpng is now harmful --- configure.in.orig 2011-08-10 10:32:39.000000000 +0900 +++ configure.in 2011-08-10 10:46:11.000000000 +0900 @@ -2458,7 +2458,7 @@ if test "${HAVE_PNG}" = "yes"; then AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).]) - LIBPNG="-lpng -lz -lm" + LIBPNG="-lz -lm" fi fi AC_SUBST(LIBPNG)