Michael could have left his fingerprints anywhere in the restaurant. But, since he had no arrest record (and the military probably didn't take his prints), the police would not have been able to match the restaurant prints to a data base. DNA analysis didn't exist in that era, so leaving the hat behind wouldn't have been a fatal mistake.
Of course, if eyewitnesses identified Michael as being either the shooter, or being in the restaurant with Sol and Mac, he would have been arrested, his prints would have been taken and matched with those left in the restaurant. But, as Olivant said, the whole thing was corrupt. Sonny was confident they could square away witnesses, and presumably they did. And since Michael disappeared immediately after the shootings, and didn't re-emerge until the case was closed (by the Bocchicchios, per the novel), that was that.

SPOILER

In the novel, two detectives visit Kay in New Hampshire while Michael's on the lam. They tell her that they know he killed the two because they have informants (presumably people from the other Families) who "point the finger" at him. But they also say that "...we have no evidence for a court of law." They tell her that they're confident that if they can find and arrest Michael, certain witnesses who are clammed up (the waiter, Sol's driver) will talk. But, of course, Michael didn't reappear until after the Bocchicchios put it to rest.


Ntra la porta tua lu sangu � sparsu,
E nun me mporta si ce muoru accisu...
E s'iddu muoru e vaju mparadisu
Si nun ce truovo a ttia, mancu ce trasu.