Handcraft config.h.in

Disable config.h.in generation in CMakeLists.txt
Whole: fix CMake generation

Revise CMake variables
Fix CMake variables generation
Other minor changes