I had the same problem and used the same solution. For completeness' sake I have included the fix I made to the routing_core.sql file in Ubuntu 12.10/Linux Mint 14. Below is an exceprt from the file showing the three changes I made replacing '$libdir/librouting' with '/usr/lib/postgresql/9.1/lib/librouting.so':
CREATE OR REPLACE FUNCTION shortest_path(sql text, source_id integer,
target_id integer, directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
AS '/usr/lib/postgresql/9.1/lib/librouting.so'
LANGUAGE C IMMUTABLE STRICT;
-----------------------------------------------------------------------
-- Core function for shortest_path_astar computation
-- Simillar to shortest_path in usage but uses the A* algorithm
-- instead of Dijkstra's.
-----------------------------------------------------------------------
CREATE OR REPLACE FUNCTION shortest_path_astar(sql text, source_id integer,
target_id integer,directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
AS '/usr/lib/postgresql/9.1/lib/librouting.so'
LANGUAGE C IMMUTABLE STRICT;
-----------------------------------------------------------------------
-- Core function for shortest_path_astar computation
-- Simillar to shortest_path in usage but uses the Shooting* algorithm
-----------------------------------------------------------------------
CREATE OR REPLACE FUNCTION shortest_path_shooting_star(sql text, source_id integer,
target_id integer,directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
AS '/usr/lib/postgresql/9.1/lib/librouting.so'
LANGUAGE C IMMUTABLE STRICT;