configure: use pkg-config for libpng, enca
configure: use pkg-config for libpng, enca

Use pkg-config to check for enca and libpng, like it is already done
for freetype and fontconfig.
Also, use libass/ass.c instead of the test program, test/test.cpp,
as the unique source identification.

libass/libass,grigorig/libass,Distrotech/libass,mwgoldsmith/libass,xbmc/libass,vault/libass,ShiftMediaProject/libass,pigoz/libass-ct,blinkseb/libass,libass/libass,tgoyne/libass,blinkseb/libass,pigoz/libass-ct,blinkseb/libass,mwgoldsmith/libass,stps/libass,Akemi/libass,MrSmile/libass,rhlee/libass,asimonov-im/libass,Distrotech/libass,tgoyne/libass,richardpl/libass,tgoyne/libass,rhlee/libass,richardpl/libass,rhlee/libass,vault/libass,stps/libass,Akemi/libass,astiob/libass,torque/libass,mwgoldsmith/libass,sanyaade-g2g-repos/libass,torque/libass,ShiftMediaProject/libass,Distrotech/libass,astiob/libass,sanyaade-g2g-repos/libass,torque/libass,sanyaade-g2g-repos/libass,grigorig/libass,pigoz/libass-ct,richardpl/libass,Akemi/libass,stps/libass,xbmc/libass,asimonov-im/libass,MrSmile/libass