Why does the speedometer in a 1991 Honda Civic work intermittently?

Problem is most Likely the ground wire on the motor by the thermostat