Did you check config.log for the exact errors?
Unless you have a specific need to use libmysqlclient, then use PHP's mysqlnd driver instead. Configure PHP by using --with-mysql=mysqlnd. See MySQL :: MySQL 5.6 Reference Manual :: 22.9.5 MySQL Native Driver (Mysqlnd) and PHP: Mysqlnd - Manual
Also unless you really, really, really need the old insecure 'mysql' extension then use either mysqli or PDO_MYSQL instead. These can be configured with --with-mysqli=mysqlnd and --with-pdo-mysql=mysqlnd