Fix CppUnit detection & libdir setup by configure, and fix Nagios libraries for unittests