The J addon for lbfgs seemed to be broken for Linux anyway. I've included all necessary bits to make it go.