Polytheists Quraysh worshipped intermediaries deities to Allah by invoking those idol-gods on earth. If Allah was simply the moon God, then He will not be regarded as the Most Surpeme rather one of the many intermediary god.
Also polytheists temples , churches, synagogues which are places of worship can be converted to mosques by simply removing sculptures and images and cleanse it before usage as place of prayer.
And mosque can simply be clean natural ground fenced by stones or wood.