Thermodynamic description of the C-Ge and C-Mg systems