Minor CMakeLists fixes and adding dl as a library to link against