In the C18 and early C19, anything man-made that was used in work was often referred to as an engine - even, occasionally, something like a spade.
I guess this probably goes back much further than the C18 (cf Shakespeare's rude mechanicals in The Dream.)