perf tools: Move compiler and linker flags check into config/Makefile