Fix linkage with boost and cleanup cmake code