Updated RPATH behaviour 

I updated the RPATH behaviour.
Modifications are the same as in https://github.com/robotology/yarp/pull/213

I tested only on OS X with RPATH enabled and it seems to work.
Maybe some tests on linux are needed (just to be sure. I don't know someone complained about the changes in yarp)
@drdanz