Improve configure script error message

Review 1908 by @larkost
Closes #2827