Failing to build bitcoin-core v0.13.1 on debian stretch
This is due to some incompatibility between Bitcoin-Core 0.13 (and below) with openSSL 1.1. openSSL 1.1 has some significant API changes: https://wiki.openssl.org/index.php/1.1_API_Changes

The pull request (patch) #9326 should fix this problem (will very likely be in 0.14).
https://github.com/bitcoin/bitcoin/pull/9326

Until this has been resolved, you should use an openSSL version below 1.1.

EDIT: this has been fixed in the bitcoin-core's MASTER branch