build: Ensure that we provide CFLAGS and LIBS for Wayland builds

We need to use PKG_CHECK_MODULES, not PKG_CHECK_EXISTS. We make it
non-fatal by passing a final argument to the m4 macro.