The only free and comprehensive online etymological dictionary of the Spanish language
conmigo (Adverb) "with me"
Prefix con- "with" added to Old Spanish migo "with me," from Latin mecum 'id.,' a compound of me "me" and cum "with."
Indo-European
Romance
Asturian conmigo, Portuguese comigo, Galician comigo, Dalmatian conmaic

The word mecum in Latin became *mego/*migo in Vulgar Latin. The phonological change from -cum to -go led to confusion of its meaning, as it was no longer identifiable as the word cum "with." By the time of Old Spanish, the word (now evolved into migo) was unclear and con- was added to reinforce its meaning. The same process happened in contigo, consigo.