Libraries and headers for compilation of a package

When I tried to compile a program from source code, I always got an error:
snpexp.cxx:63:2: error: #error this program requires bam.h, bgzf.h and libbam
The corresponding part in the source code of snpexp.cxx reads as (without line numbers):

 60 #ifdef HAVE_BAM_H
 61 #include <bam.h>
 62 #else
 63 #error this program requires bam.h, bgzf.h and libbam
 64 #endif

which is exactly what the author stated in the README:

# Install
# 
# Before building this project, you have to install libbam provided by Li et al. (http://samtools.sourceforge.net/). 
# If you build SAMtools bam.h, bgzf.h and libbam.o files will appear in the directory. These files should be
# copied topaths for header files and library files typically at /usr/local/include/ and /usr/local/lib/.
#
# If these files are correctly installed, you can setup and build the program.
# 
# ./configure
# make
#
# Built binaries can be installed your executable paths.

It seems I have those requirement installed, as a copy of the two files (bam.h, bgzf.h) have been copied to /usr/local/include which can be confirmed when I issued:

./configure
......
checking for zlib.h... yes
checking bam.h usability... yes
checking bam.h presence... yes
checking for bam.h... yes

And in the Makefile derived from the configuration above, it can be seen:

......
LIBS = -lz -lbam -lpthread
includedir = ${prefix}/include
prefix = /usr/local
......

And I do have those files in my system (Ubuntu 18.04):

/usr/local/lib/libbam.a
/usr/local/include/bam.h
/usr/local/include/bgzf.h
...

and the tools I used are:

GNU Make 4.1 Built for x86_64-pc-linux-gnu
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

but I simply always got the error message. I have wrote to the author, maybe the package is a little bit old there is no update/response.
This may not have a simple answer, but I appreciate if anyone can point me the possible direction(s) that I could have missed. Thank you!

A wild shot ...

includedir = ${prefix}/include
prefix = /usr/local

Shouldn't prefix definition preceed includedir definition?

Thanks! Tried changing that according to your advice, same error.

Often when I have problems with libs, the solution which works for me is ldconfig, but in your case, since you are not using shared libs, I don't think this solution will be helpful; however, I will mention it anyway, just in case:

Just yesterday, I found an error in my make file. But the project was compiled correctly due to the following construction of adding the local directory "include" to the search. Maybe it will be useful

vpath %.h include
Summary

Now it remains to find the old topic and fix the error

Thanks! Your way did not work, and I believe the PATH related is correct. Another thing is the ./configure part which has a lot of things included. Thanks anyway.