Only run tests when unit tests enabled

If you do run make check, and unit tests are not enabled, compilation fails because the boost test framework is not detected. To fail earlier is a lot nicer :)