Refactor configure's toolchain triplet generation