fixed cmake adding of linker flags #869