Marx was born in 1818, over a century after Locke's death. If Locke was a materialist, it had nothing to do with Marx's influences, or those of those who immediately influcencd Marx, notably Feuerbach and Hegel.
I phrased my statement badly. I meant you could trace Marx’s thought partially to Locke.