Recursively build and configure mLib and mgLib.