Cohesive energies of Be and Mg Chalcogenides