2 Different sources in 2 different targets
I used a 9V source for the Arduino mega and the other source to power the Motors, I’ve attached a comparable circuit design with it for your convenience 
I haven’t shown capacitors, but its good to use capacitors. And to supply power to the motors, I’ve used 2 9V battries in parallel. Please check the design in the top.