replaced speedometer driven gear with recommended 40 tooth and still not accurate...

Your speedometer most likely needs rebuilt. I am dealing with the same issue. Using the correct gear, speed shows low according to gps speed. If I change the gear to show accurate on the needle it throws the odometer way off. There are two tabs that spin around a wheel which moves the needle.

With the correct gear in your car, google map the distance driven with the odometer and see if it is close.
If you want to do the math you can double check using this formula. If the math is correct, the speedo is out of calibration like others have mentioned.

62-5 SPEEDOMETER DRIVE GEAR CHART-PIC.PNG