Hamaker-constant calculations and surface melting of metals, semimetals and semiconductors