From an Alpine substrate language. The original sense is that of a pasture, the use for a building is secondary; hence no relation with Arabic مَلْجَأ (maljaʔ, “refuge”).
Practice speaking and memorizing "malga" and many other words and sentences in Italian.