You manually forced use of the cross compiler. However, the rest of the build toolchain will still default to the 32-bit Cygwin versions instead of the 64-bit MinGW ones.
Instead of setting CC=...
, pass --host x86_64-w64-mingw32
to ./configure
to specify the host environment (ie where the library is going to be used).