Sophie -
If you think that error is related to no compile time TLS support then don't connect asterisk to ejabberd using TLS:
in asterisk jabber.conf under the ejabberd context:
usetls=no ;don't connect using TLS for debugging purposes
usesasl=no ;use plain text authentication for debugging too
Refer to the documentation for ejabberd and tell it to NOT to connect with TLS and SASL and see what happens.
If that works then follow the wiki instructions for retrieving and compiling iksemel with gnutls or openssl support and then recompile asterisk using the previous procedure making sure you run 'make clean' or 'make distclean' first...
then turn on TLS and SASL one at a time and test... Good Luck