If you want to target the last element from a list of elements, this would help:
.menu li(:last-child) {
margin: auto;
}
And if you want to select all the elements in a list except for the last element, just add a :not
:
.menu li:not(:last-child) {
margin: auto;
}