Update CMakeLists.txt

fixed the if-else-endif expression in the CMakeLists, so that it works on Windows & Linux