Add CMake checks for LFS and moved relevant macros to config.h.