Add PKG checks to configure.ac and adapt Makefile.