Synergy builds fine on the PI platform with a couple of fixes. For that error you will need to install the libx11-dev package and while installing packages you might as well install libxtst-dev & cmake packages.
Then in an editor open the CMakeLists.txt file and search for X11, you should end up finding the following line: set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include") you will need to change this line to be the following: set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/include").
Now if you run ./configure it should work fine. if you still get the same error you will need to move, copy, delete the cache file CMakeCache.txt.
From there you should be good to go. This was all info i found from this post http://www.rootusers.com/compiling-synergy-from-source-on-the-raspberry-pi/