improve compiler selection and fixup pkg-configs