Fix Lexer on failure.

    The lexer was generating error messages but not stopping if there was an error.
    This was because we were piping the output of lex into sed and sed always was OK.

    So introduced an intermediate file. Thus if flex fails we see the error code and
    print the appropriate error messages and stop. If flex succeeds then we perform
    the sed operation to generate the appropriate output.
Fixed build for header only library