configure: Refactor toolchain flag setting