I believe people should be able to peacefully associate with others in any way all parties voluntarily agree to.
If a group of people want to call their associations a “team,” or a “corporation,” or a “marriage,” or a “commune,” or a “government,” fine - so long as they do not aggress against those who do not wish to associate with them. These associations cannot presume authority over any peaceful individual who does not consent.
In other words, there is very little I would consider “legitimate” in government (and even less* that I would consider “efficient” or “necessary”).
Hopefully, the people of Libya find their own way to emerge from this mess. Unfortunately, there’s no doubt that westerners will impose their will over Libyans just as they have around the world.