fixing linking
a bunch of CMake fixes to get tests passing.