build: Several updates of the build scripts

- Redesign the way default compile flags are determined.

  This includes a small semantical change with flag processing:
  * there are now "general" compiler and link flags. These are added (if
    supported) even if CXXFLAGS and/or LINKFLAGS environmental variables
    are set.
  * optimization/debug-mode flags that are applied only if CXXFLAGS
    and/or LINKFLAGS environmental variables are not set.

- Fix define constant for sqlite3.

  When pkg-config detection used, it requires `global_define` flag.
  Otherwise define is applied only when the module is included in the
  build target using 'use' statement.

- Remove openssl dependency

  This dependency was redundant for a long time

Change-Id: Icf66fb5300954893cc2d07e022b8a0998ec894e5
Refs: #2209
diff --git a/tests/unit-tests/ndebug.cpp b/tests/unit-tests/ndebug.cpp
index 8b9598c..e3e4569 100644
--- a/tests/unit-tests/ndebug.cpp
+++ b/tests/unit-tests/ndebug.cpp
@@ -30,7 +30,7 @@
 
 BOOST_AUTO_TEST_CASE(AssertFalse)
 {
-#ifndef NDN_CXX__DEBUG
+#ifndef _DEBUG
   // in release builds, assertion shouldn't execute
   BOOST_ASSERT(false);
 #endif
@@ -40,7 +40,7 @@
 {
   int a = 1;
   BOOST_ASSERT((a = 2) > 0);
-#ifdef NDN_CXX__DEBUG
+#ifdef _DEBUG
   BOOST_CHECK_EQUAL(a, 2);
 #else
   BOOST_CHECK_EQUAL(a, 1);