changed hard coded -lpng to LIBPNG_LIB_DIRS and LIBPNG_LIBS