Thermoelectric efficiency of nanoscale devices in the linear regime