It may be very difficult to unite several countries together under a single pact to form some semblance of an international government, but it will become increasingly necessary in the future. The Euro Zone, for example, by uniting and adopting the Euro as its currency, has strengthened the collective well-being of each member nation by protecting them against inflation and other economic disasters.
Any government is only morally legitimate if it is a government chosen by those citizens it presumes to govern. So if member citizens of the countries seeking to form an international government agree to its formation, such a government would clearly be legitimate. If they did not agree, the international government has no legitimacy.