if os.path.exists(p + "/config/Makefile") ---------> if os.path.exists(p + "/config-x86_64-linux-gnu/Makefile")