Good Morning Vasily:
You can use the shell environment variables:
MYSQLINC and MYSQLLIBS
to override the automatic detection of where MySQL
include files and libraries are located.
For example:
export MYSQLINC=/usr/local/mysql/include/mysql
export MYSQLLIBS="/usr/local/mysql/lib/mysql/libmysqlclient.a -lz"
--Hiram