BUG: Bug fix for Issue #5315

Added new logic to the fortran compiler version check to handle cases where
gcc is built with "--with-pkgversion=*some_string*, where *some_string*
contains numbers that might be incorrectly interpreted as a gcc version.

This includes some additional tests. All tests run successfully on Linux
Python version 2.7.8 and 3.4.2.
I'd also suggest using 's' instead of 'vstring' and 'cnt' instead of 'lparen'. The 'string_no_paren' variable is superfluous and you should also check if a matching parenthesis is ever found, raising an error if not.