Despite their conceptual and phonetic similarity, no - they come from distinct PIE roots. Their unrelatedness becomes more clear when we consider that the initial /x ~ h/
pronunciation of the 'j' in Spanish only developed in the 17th-18th centuries, and before this jamón was pronounced /ʃa'mon/
(and originally /ʒa'mon/
).
PIE
*kónh₂m (“leg”)
Proto-Germanic
*hamō, *hammō, *hanmō
Old English
*hamm (“inner or hind part of the knee, ham”)
PIE
*kamp- (“to bend; crooked”)
Ancient Greek
κάμπη (kámpē)
Late Latin
gamba
Old French
jambe, gambe (“leg”)
French
jambon, gambon
Spanish
jamón
English
gammon
Note however that the synonym gammon is cognate to jamón (both inherited from the French jambon).