The correct form is as illustrated by any of the following - there must be an apostrophe but there is ambiguity as to whether you would add the s/z sound.
a friend of John's and mine
a friend of Thomas' and mine
a friend of Thomas's and mine
For the parallelism of and to work, they must be the same part of speech, in this case a possessive substantive. The possessive makes it mean a member (genitive) of the circle of X's friends.
You could also say (perfectly grammatical but stylistically deprecated by some):
? a friend of John and me
but not (perfectly ungrammatical but incorrectly taught/used by many):
The question remains as to why we say one but not the other of the following:
a friend of mine
? a friend of me
This is not a matter of being syntactically wrong, but semantically/pragmatically awkward. Consider:
a photograph of mine
a photograph of me
Here the semantic difference is crystal clear (although the first one could refer either to the face that I and the "actor" who took the photo or I was given/sold the photo). In the first case, it is now part of a collection you posses (just like the friends) and so possessive or partitive genitive is appropriate. In the second case it a patientive genetive - I am the "undergoer" or "patient" of the process of taking the photo, and this dominant genitive usage doesn't reconcile with the "friend" example.
In general in any language there is no such thing as perfect synonymy, at the level of individual words or phrases. Generally, any (content) word can be forced into any part of speech role as long as there is no other word that already fits the intended purpose.
Viz. you can't use "of me" as a possessive as "me" has possessive forms "my" and "mine" - and in old English that could also be used as an adjectival form, "mine eyes have seen the glory" - just like "an"/"one" and "thine" before a vowel, or glottal stop or clausal punctuation, the /n/ form must be used, but before a consonant it is elided. I.e. the difference between "my" and "mine", like "a" and "an" is morphophonemic rather than syntactic.