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

I don't think it's the gear. 40 tooth is as close as you'll ever get with 25.6" tire and 3.91 gears. Sounds like the speedometer itself isn't working right. You could also check your rear end gear ratio. Guessing at that just makes things even more difficult to diagnose.