Bottom line is this. 30 mph is fairly cheap, but 40 mph takes a lot more watts. Then you get to spend a lot more than $500 on a battery that still will run more than 3-5 miles.
The motor you were looking at sounds like it would kill an affordable battery in a few weeks. A typical "bike" lifepo4 battery can handle at the very most 30 amps. But it's going to hate it, and it will damage it. Better, is to stick to less than 25 amps. That will last. A typical "20 amps" controller common in kits is actually set to 22 amps. With a 48v battery, it produces about 1200 peak watts. It's enough to reach 30 mph on faster windings, or 27 mph on slightly slower ones. 6 or 7 turns of the winding direct drive motors.
Lower your sights. 30 mph on an ebike is pretty quick, and 30 mph takes about 1000w. 40 mph club membership generally takes 3000w. so it's three times more expensive.
A cheap dd hub will still be very fun at 48v. And the battery is going to be fairly affordable, though you might spend closer to 6-700 bucks for one that is safe and easy to charge.
But later, that same hub could be hooked up to RC lico (lipo) batteries, and run at 72v 40 amps, 3000w. Bing, you are in the 40 mph club.
Since your budget is limited at this time, start out with an affordable motor, and 48v. A Mac 10 T is very poplular at 48v, and 1500w. But don't take the Mac to 3000w.