Well...very often the solution to a problem is the simplest one.
As I wrote I used the command
gcc -L../glpk/lib -lglpk main.c cplex.c -o proximityglpk
to compile. Like someone had noticed, I'm new on compiling and linking manually (usually I use XCode) and I made a stupid mistake. The flag of the libraries must be placed after the object to which you want to link the libraries. So the command
gcc main.c cplex.c -L../glpk/lib -lglpk -lm -o proximityglpk
solved my problem. Now I have an executable that can run on the computing server!!
I'm sure that almost all of you know how to put the libraries flags, probably no one noticed that.
But thank you very much for all your help.