util: NetworkMonitor: fix build on unsupported platforms

Change-Id: I08ef2c3858e0aea35ec2de739ddd86734b40358d
Refs: #3353
diff --git a/tests/unit-tests/util/network-monitor.t.cpp b/tests/unit-tests/util/network-monitor.t.cpp
index bac8750..0e6e599 100644
--- a/tests/unit-tests/util/network-monitor.t.cpp
+++ b/tests/unit-tests/util/network-monitor.t.cpp
@@ -33,15 +33,17 @@
 
 BOOST_AUTO_TEST_CASE(DestructWithoutRun)
 {
+#if defined(NDN_CXX_HAVE_RTNETLINK) || defined(NDN_CXX_HAVE_COREFOUNDATION_COREFOUNDATION_H)
   boost::asio::io_service io;
   auto nm = make_unique<NetworkMonitor>(io);
   nm.reset();
+#endif
   BOOST_CHECK(true); // if we got this far, the test passed
 }
 
 BOOST_AUTO_TEST_CASE(DestructWhileEnumerating)
 {
-#ifdef __linux__
+#ifdef NDN_CXX_HAVE_RTNETLINK
   boost::asio::io_service io;
   auto nm = make_unique<NetworkMonitor>(io);