There is a problem here that flyback diodes alone cannot solve - the relay is a mechanical switch so it has significant dead time (open circuit). Thus there will be high voltage transients and arcing - since the polarity switches you can't just put a diode across the motor to prevent this.
An RC snubber across the motor is probably needed, and you'll still need a flyback diode the other side of the relay to protect the PWM transistor.
The RC values depend on the motor characteristics - and not in an easy to calculate way I fear. The cap has to absorb the magnetic energy without going to too high a voltage and the R has to dampen the oscillations of what would otherwise be a resonant LC circuit.