Browsing through the Jewish Y-DNA Project, I found two individuals with the surname Marx, one descending from Nathan Marx from Karlsruhe in Baden-Württemberg, and the other from Martin Marx from Frankenthal in Rhineland-Palatinate in the early 19th century. Karl Marx came from Trier also in Rhineland-Palatinate, not very far from either Frankenthal or Karlsruhe. Both lineages belong to haplogroup J1, but the haplotypes do not match, meaning that they are distinct patrilineal lineages. However since Marx isn't such a common Jewish surname and both lineages originated in the same part of Germany, around the Moselle valley, it is quite possible that Karl Marx descends from a common ancestor with one of those two lineages. In either case he would belong to haplogroup J1.