1540s, "structure of any kind," from Middle French machine "device, contrivance," from Latin machina "machine, engine, military machine; device, trick; instrument" (source also of Spanish maquina, Italian macchina), from Greek makhana, Doric variant of Attic mekhane "device," from PIE *magh-ana- "that which enables," from root *magh- "to be able, have power."
Main modern sense of "device made of moving parts for applying mechanical power" (1670s) probably grew out of mid-17c. senses of "apparatus, appliance" and "military siege-tower." In late 19c. slang the word was used for both "penis" and "vagina," one of the few so honored. Political sense is U.S. slang, first recorded 1876. Machine age is attested by 1851:
The idea of remodelling society at public meetings is one of the least reasonable which ever entered the mind of an agitator: and the notion that the relations of the sexes can be re-arranged and finally disposed of by preamble and resolution, is one of the latest, as it should have been the last, vagary of a machine age. ["The Literary World," Nov. 1, 1851]
Machine for living (in) "house" translates Le Corbusier's machine à habiter (1923).