Going by its Wikipedia page, materialism has been largely discredited due to advances in physics as it cannot explain phenomena such as gravity which apparently exist without the connivance of matter. Considering some of the dates involved in the history of materialism—the earliest in the wiki being ~6th century BCE—how did materialists historically fit magnetism, a known phenomenon at the time, into their model?
According to John Burtnet, Thales believed that:
Aristotle said, in De Anima:
In other cases, magnetism was regarded as "divine attraction" -- in other words, magic. It's also noteworthy to say that even though materialists believed that all things are made up of material stuff -- be it water, earth, fire, etc -- this did not mean that souls could not exist (see Epicurus, for example). Empedocles, another materialist, actually believed in the transmigration of souls.
Here's a great paper that discusses magnetism and electricity in ancient Greece. Awesome question, +1.