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

#### Reviewers
@flopezag