errors while building ffmpeg with ndk16b standalone toolchain

I am trying to build ffmpeg with android ndk18b toolchain. My configuration looks like this.

TOOLCHAIN_PREFIX=/home/git/ndks/stand_alone_toolchain_ndk16b
NDK_SYSROOT=$TOOLCHAIN_PREFIX/sysroot
NDK_ARCH='arm'
NDK_ABIARCH='arm-linux-androideabi'
target_host=arm-linux-androideabi
export CPP="${CROSS_PREFIX}clang++"
export PATH=${TOOLCHAIN_PREFIX}/bin:$PATH
export CROSS_PREFIX=${TOOLCHAIN_PREFIX}/bin/${NDK_ABIARCH}-
export CC="${CROSS_PREFIX}clang"
export CXX="${CROSS_PREFIX}clang++"
export AS="${CROSS_PREFIX}clang"
export AR="${CROSS_PREFIX}ar"
export LD="${CROSS_PREFIX}ld"
export RANLIB="${CROSS_PREFIX}ranlib"
export STRIP="${CROSS_PREFIX}strip"
export OBJDUMP="${CROSS_PREFIX}objdump"
export CPP="${CROSS_PREFIX}cpp"
export GCONV="${CROSS_PREFIX}gconv"
export NM="${CROSS_PREFIX}nm"
export SIZE="${CROSS_PREFIX}size"

# Tell configure what flags Android requires.
export CFLAGS="-fPIE -fPIC"
export LDFLAGS="-pie"

./configure \
    --cpu="armv7-a" \
    --enable-pic \
    --disable-runtime-cpudetect \
    --enable-pthreads \
    --enable-hardcoded-tables \
    --prefix=$PREFIX \
    --disable-doc \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-doc \
    --disable-network \
    --enable-libmp3lame \
    --enable-libx264 \
    --enable-gpl \
    --extra-ldflags="-latomic -L${NDK_SYSROOT}/usr/lib -L$TOOLCHAIN_PREFIX/arm-linux-androideabi/lib -L$TOOLCHAIN_PREFIX/lib -Llibmp3lame/lib -Lx264/android/armeabi-v7a/lib $LDFLAGS -v -lc -lm -ldl -llog -march=armv7-a"\
    --extra-cflags="-ffast-math -funroll-loops -mfloat-abi=softfp -mfpu=vfpv3-d16 -Ilibmp3lame/include -Ix264/android/armeabi-v7a/include $CFLAGS -march=armv7-a -marm -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 -mthumb -D__thumb__ -fno-exceptions -fno-rtti -march=armv7-a -Wl,--fix-cortex-a8" \
    --arch=arm\
    --target-os=linux \
    --enable-cross-compile \
    --cross-prefix=$TOOLCHAIN_PREFIX/bin/arm-linux-androideabi- \
    --nm=${NM} \
    --cc=${CC} \
    --cxx=${CXX} \
    --ld=${LD} \
    --ar=${AR} \
    --as=${AS} \
    --strip=${STRIP}

I have build libmp3lame using this http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI and placed inside libmp3lame/lib folder.

I am getting these undefined errors in config.log.

/home/git/ndks/stand_alone_toolchain_ndk18b/bin/arm-linux-androideabi-clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -fPIE -fPIC -ffast-math -funroll-loops -mfloat-abi=softfp -mfpu=vfpv3-d16 -Ilibmp3lame/include -Ix264/android/armeabi-v7a/include -fPIE -fPIC -march=armv7-a -marm -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 -mthumb -D__thumb__ -fno-exceptions -fno-rtti -march=armv7-a -Wl,--fix-cortex-a8 -march=armv7-a -std=c11 -fomit-frame-pointer -fPIC -mthumb -c -o /tmp/ffconf.PT1BY4UI.o /tmp/ffconf.5z69vrhC.c clang70: warning: -Wl,--fix-cortex-a8: 'linker' input unused [-Wunused-command-line-argument] /home/git/ndks/stand_alone_toolchain_ndk18b/bin/arm-linux-androideabi-ld -pie -latomic -L/home/git/ndks/stand_alone_toolchain_ndk18b/sysroot/usr/lib -L/home/git/ndks/stand_alone_toolchain_ndk18b/arm-linux-androideabi/lib -L/home/git/ndks/stand_alone_toolchain_ndk18b/lib -Llibmp3lame/lib -Lx264/android/armeabi-v7a/lib -pie -v -lc -lm -ldl -llog -march=armv7-a -o /tmp/ffconf.o9IsP7bS /tmp/ffconf.PT1BY4UI.o -lmp3lame -lm -lz libmp3lame/lib/libmp3lame.a(set_get.o)(.ARM.exidx.text.lame_set_num_samples+0x0): error: undefined reference to '__aeabi_unwind_cpp_pr0' libmp3lame/lib/libmp3lame.a(set_get.o)(.ARM.exidx.text.lame_set_ogg+0x0): error: undefined reference to '__aeabi_unwind_cpp_pr0' libmp3lame/lib/libmp3lame.a(set_get.o)(.ARM.exidx.text.lame_get_ogg+0x0): error: undefined reference to '__aeabi_unwind_cpp_pr0' libmp3lame/lib/libmp3lame.a(set_get.o)(.ARM.exidx.text.lame_set_quality+0x0): error: undefined reference to '__aeabi_unwind_cpp_pr0' D:/work_dir/battefield3/chimpoon/proj.android/app/jni/../../../../lame/lame-3.100/./libmp3lame/set_get.c:2161: error: undefined reference to '__aeabi_uidiv' D:/work_dir/battefield3/chimpoon/proj.android/app/jni/../../../../lame/lame-3.100/./libmp3lame/set_get.c:2165: error: undefined reference to '__aeabi_uidivmod' D:/work_dir/battefield3/chimpoon/proj.android/app/jni/../../../../lame/lame-3.100/./libmp3lame/set_get.c:2170: error: undefined reference to '__aeabi_uidiv'

Please help me to resolve this issue. Thanks.