Masses of ground-state mesons and baryons, including those with heavy quarks