It's impossible to make a perpetual motion machine with magnets because magnets go bad. A magnet is made of iron, and in the iron the atoms are "relaxed". Don't ask me how, but to make a magnet, you need to "charge" the particles. Eventually, the particles relax again, and the magnet dies. How long depends on the type of magnet and the usage. So, in conclusion, unless you could get enough power to control a "magnet charger" after 100 years or so, you can't do it. you can, however, make a really long lasting motor.