Check for doxygen before building

Make does not complete without error if doxygen is not installed properly or the document generation is not successful. This patch fixes this issue.