Add m4/pkg.m4 which defines PKG_CHECK_MODULES macro. Modify configure.ac to skip pkg-config test if pkg-config isn't present.