Obtaining cluster expansion coefficients in ab initio thermodynamics of multicomponent lattice-gas systems