Connecting a motor so that it draws power from the generator it powers does not pose a serious engineering challenge. The laws of physics, however, render the device unworkable. The conservation of energy is a fundamental principle of the universe, and it prevents perpetual-motion machines from creating energy from nothing.
The problem with a perpetual-motion machine of the first order, which is one that keeps running without input from outside, is that no transfer of energy is ever 100 percent efficient. Energy will inevitably be lost from a closed system, though not destroyed, and without more energy being added from outside, the machine would simply run down and stop.