Fixed build issue on FreeBSD

or it gives the error "error: exception handling disabled, use -fexceptions to enable".