Referring to FFMPEG official guide the right commands should be:
./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass \
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus \
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
make && sudo make install
Be sure you have also x264, because working with OpenCV may require additional codecs (especially for video processing).