Modeling of covalent bonding in solids by inversion of cohesive energy curves