I think I used this in the past to compile rtmpdump-ksv, but I'm not sure if this is still valid.
sudo apt-get install ntp zlib1g-dev supervisor unzip build-essential checkinstall git libssl-devpostfix
wget https://www.openssl.org/source/old/1...-1.0.2l.tar.gz
tar xvf openssl-1.0.2l.tar.gz
cd ~/openssl-1.0.2l
./config
make depend
make
sudo make install
cd ~
git clone https://github.com/BurntSushi/rtmpdump-ksv.git
cd rtmpdump-ksv
make SYS=posix INC="-I/usr/local/ssl/include -L/usr/local/ssl/lib" LDFLAGS="-L/home/ubuntu/openssl-1.0.2l"
sudo make install