set PKG_CONFIG_PATH properly

when building libraries, so pkg_config can find libatomic_ops for libgc
fix makefile so a spurious error is not given

when it greps for runtime dynamic library search paths in the M2 binary, and
there are none