Failed to link -lpng while 'make reftest' is fixed.

I failed at make check, and find the problem in check.mk