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

If you have a Smart phone, go to the APP store & get a speedo app. Put the phone on your dash & compare what it reads, versus your speedo. Then you will know how far off it is.