Atmospheric characterization of terrestrial exoplanets in the mid-infrared