Add configure checks

Hi David, 

Would be great if you could integrate this pull request. Let me know if you have any question. 

Thanks
Jc