build: pass pkg_config_path to check_cfg() when looking for libndn-cxx

Instead of modifying os.environ

Refs: #5042
Change-Id: Iaf1b87e99d2df6541bc44b1a2f49651c3d5f8c0e
diff --git a/wscript b/wscript
index ffffd5e..1357ce8 100644
--- a/wscript
+++ b/wscript
@@ -93,9 +93,8 @@
 
     conf.find_program('bash', var='BASH')
 
-    if 'PKG_CONFIG_PATH' not in os.environ:
-        os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
-    conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'], uselib_store='NDN_CXX')
+    conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'], uselib_store='NDN_CXX',
+                   pkg_config_path=os.environ.get('PKG_CONFIG_PATH', '%s/pkgconfig' % conf.env.LIBDIR))
 
     if not conf.options.without_systemd:
         conf.check_cfg(package='libsystemd', args=['--cflags', '--libs'],