mescc: Refactor mlibc compilation.