We get into trouble because snakes came from ancestors that had legs, but lost them secondarily. We will learn later what a diapsid skull is, see PJH Fig. 10-21 if you are impatient. Snakes are derived members of the Amniote clade as well as the Diapsid clade. Refer to PJH Fig.
Legs are synapomorphic in tetrapods, and plesiomorphic in amniotes.
Loss of legs is apomorphic in amniotes, and in diapsids as well. P Cladograms 5 and 6 show two phylogenies. You might chose 5, because of parsimony. However, cladogram 6 is the correct one. Because the common ancestor of bats and birds did not have wings, bat wings and birds cannot be homologous as wings.