Had some trouble compiling alpine for 64 bit Solaris the other day. I used the following for my configure:
CFLAGS=-m64 ./configure \
Where I had openssl/0.9.8j already compiled in 64 bit. The trick was that when I did a make, c-client would fail because it was compiled as a 32 bit. So I did a make clean, ./configured again, and then edited the EXTRACFLAGS option with -m64 in the Makefile in the imap subdirectory. Doing a make after that work great!