It’s worth looking into the context of Marx’s oft-quoted remark “I’m not a Marxist” , which is often used by people who like their Marx but are not so sure about some of his followers, especially during the period of the rise of the European social democratic parties. Very often the implication is that Marx made his remark as a means of distancing himself from some of the most overtly opportunistic currents in social democracy, people who already in his day were busying themselves with “state socialist” schemes and looking for ways to ally themselves with the likes of Bismarck in order to reform capitalism into socialism.
Of course, Marx spent a good part of his latter years combating these people. But the remark in question was not so much directed against the deviations from the right of the party, but against something which Marx would probably have called a form of “sectarianism”, a refusal to get involved in practical struggles.
The following passage is from the introduction to the Programme of the Parti Ouvrier on www.marxists.org:
“This document was drawn up in May 1880, when French workers' leader Jules Guesde came to visit Marx in London. The Preamble was dictated by Marx himself, while the other two parts of minimum political and economic demands were formulated by Marx and Guesde, with assistance from Engels and Paul Lafargue, who with Guesde was to become a leading figure in the Marxist wing of French socialism. The programme was adopted, with certain amendments, by the founding congress of the Parti Ouvrier (PO) at Le Havre in November 1880.
Concerning the programme Marx wrote: “this very brief document in its economic section consists solely of demands that actually have spontaneously arisen out of the labour movement itself. There is in addition an introductory passage where the communist goal is defined in a few lines.”  Engels described the first, maximum section, as “a masterpiece of cogent argumentation rarely encountered, clearly and succinctly written for the masses; I myself was astonished by this concise formulation” and he later recommended the economic section to the German social democrats in his critique of the draft of the 1891 Erfurt Programme.
After the programme was agreed, however, a clash arose between Marx and his French supporters arose over the purpose of the minimum section. Whereas Marx saw this as a practical means of agitation around demands that were achievable within the framework of capitalism, Guesde took a very different view: “Discounting the possibility of obtaining these reforms from the bourgeoisie, Guesde regarded them not as a practical programme of struggle, but simply ... as bait with which to lure the workers from Radicalism.” The rejection of these reforms would, Guesde believed, “free the proletariat of its last reformist illusions and convince it of the impossibility of avoiding a workers ’89.”  Accusing Guesde and Lafargue of “revolutionary phrase-mongering” and of denying the value of reformist struggles, Marx made his famous remark that, if their politics represented Marxism, “ce qu'il y a de certain c'est que moi, je ne suis pas Marxiste” (“what is certain is that I myself am not a Marxist” (a remark cited by Engels in his letter to Bernstein of 2-3 November 1882).
If you look at the programme of the Parti Ouvrier, it includes a number of demands which raise the eyebrows today. Some of the economic demands indeed look like realisable goals within the framework of a capitalist society which was still in its ascendant phase and capable of granting real reforms to the working class: legal minimum wage, legal rest day each week, equal pay for men and women, bosses’ responsibility for compensating industrial accidents, etc. But some of the more political demands are more open to question – such as “abolition of the standing army and the general arming of the people”, or “the Commune to be master of its administration and its police”. These demands – which do indeed seem unrealisable within the framework of capitalism - were intimately linked to the notion, enshrined in the document, that the working class could use universal suffrage and the democratic republic as a means for taking political power.
The programme of the Parti Ouvrier thus states that universal suffrage could be “transformed from the instrument of deception that it has been until now into an instrument of emancipation”. In his critique of German social democracy’s Erfurt programme in 1891, Engels refers to the programme of the French party as a model for the Germans to follow. Here he is even more explicit that the democratic republic could, at least in the countries with a functioning parliamentary system, become an instrument for the political emancipation of the working class:
“One can conceive that the old society may develop peacefully into the new one in countries where the representatives of the people concentrate all power in their hands, where, if one has the support of the majority of the people, one can do as one sees fit in a constitutional way: in democratic republics such as France and the U.S.A., in monarchies such as Britain, where the imminent abdication of the dynasty in return for financial compensation is discussed in the press daily and where this dynasty is powerless against the people. But in Germany where the government is almost omnipotent and the Reichstag and all other representative bodies have no real power, to advocate such a thing in Germany, when, moreover, there is no need to do so, means removing the fig-leaf from absolutism and becoming oneself a screen for its nakedness”.
These lines were written, it should be recalled, after the Paris Commune, whose principal lesson, according to Marx and Engels, had been that the working class cannot simply lay hold of the existing state machine but has to smash it and create an entirely new apparatus. Evidently the implications of the lessons they themselves drew from this experience had not been taken to their conclusion. As it happens, it was Lenin, in State and Revolution, a work often dismissed as doing no more than dig up old quotes from Marx and Engels, who concluded that in the epoch of the imperialist, militarist state announced by the first world war, the epoch of proletarian revolution announced by the social upheavals in Russia, the necessity for the violent destruction of the bourgeois state clearly held for all countries in the world.
So Marx, on this point at least, reckoned he was “not a Marxist” not because his teachings had been distorted by openly opportunist currents, but because he did not agree with those who were ready to ditch the “minimum” programme and substituted revolutionary phrases for the patient work of building the class party – a position most obviously crystallised in the anarchist current for whom Marx was rarely seen as something more than the spokesman of an oppressive form of statism and reformism.
There can be no doubt that in carrying out this difficult struggle on two fronts, both Marx and Engels made some substantial errors. Engels in particular was pulled towards the notion of the social democratic party gradually conquering material positions within the old society as a prelude to revolution, a perspective which turned out to be pure illusion, since it was capitalist society which was gradually ‘conquering’ the social democratic parties for its own interests, as the watershed of 1914 finally brought home.
The point remains: however much we can criticise the weaknesses of the social democratic parties and their theorists during the latter part of the 19th century, however much we may point to the huge gulf between Marx’s work and their interpretation of it, it is meaningless to draw a class line between Marx, Engels and the social democratic parties. They were all expressions of the “real movement” of the proletariat; and thus subject to all kinds of mistakes and inevitably limited by the conditions of their times.