The Machine-to-Machine (M2M) technology, currently under standardization at both the ETSI and 3GPP, is expected to be one of the most promising revenue-generating services. However, to ensure the wide spread of this technology, M2M communications should be secure, fault-tolerant and selfmanaged. In this work, we add to the M2M gateway (an aggregator node in the M2M architecture) the self-healing and self-optimizing autonomic capabilities. We couple at the M2M gateway level the Host Identity Protocal (HIP) with the Reachability Protocol (REAP). REAP enables a self-healed M2M communication as it detects possible failures and seamlessly rehomes an M2M established session to a new working overlay path. Furthermore, we modify REAP to ensure self-optimized M2M communications. REAP continuously monitors M2M overlay paths and always selects the best available ones in terms of RTT. We implement our solution on the OMNeT++ network simulator. Results show that M2M sessions effectively resume after an outage affecting their currently used M2M overlay paths. Results also highlight that M2M sessions autonomically select the best available M2M overlay paths.