Multi-terminal thermoeletric machines in nanoscale systems