What to wire ground to?
Edit:I misread your question for the 2nd time...I was answering it in a rush. I didn't realize that the motor was being used as a generator, and I thought it was the output of the circuit.
Here is a diagram with the capacitors and the correct connections. The diode should be chosen, so that the max motor output voltage minus the diode's forward voltage drop is less than the maximum input voltage of the regulator's input:







simulate this circuit &ndash; Schematic created using CircuitLab