improve error handling in case of program linking problems

Hi Patrick,
I've added a minor improvement, you can pull the commit if you like it.

Cheers,
Harald