The most likely cause of being told "look just do it" by a superior is information asymmetry: either of you or both of you know something that other party doesn't. The manager might not be telling you that in the grand scheme of issues this specific problem is fairly unimportant or they just looking for a quick fix, since there is much pressure from someone else to get the thing done quickly or they simply might plan not to stick around long enough to take responsibility for the consequences.
In a similar manner they might not be able to fully appreciate the risks associated with the adverse choice, may be deliberately making “wrong” pick since it helps them to meet their personal goals etc. Information asymmetry http://en.wikipedia.org/wiki/Information_asymmetry is a well known concept in the field of economics and you might want to read up on the topic.
The most likely cause, however, is a looming deadline, lack of planning and hence the total absence of time for any manoeuvres.
Solutions are many. There are two that worked for me best:
a) Improve communication; communicate more often and more efficiently. This means listening more, trying to understand whether the problem is lack of understanding of the risks associated with the poor quality, lack of appreciation of the software quality and adverse effects of taking shortcuts on the future maintainability (it staggers me that often it is the same people who would buy only best quality very expensive cars and insist on taking shortcuts in building software, highlighting the difference in how personal and non-personal choices are treated).
Or the issue might be that whilst actually fully appreciating the value of software quality and understanding the impact of future system maintainability (in my personal experience this is less common) they make a conscious decision to go down a cheaper route.
In essence, communication here means not that much trying to actively sell what you've got on your mind, but to try and absorb as much information as possible from the environment and the manager. Then it is going to be much easier to figure out your next step.
b) Alliances and partnerships. It is impossible to overstate the value of alliances. Even when your manager or project sponsor does not provide adequate support for quality (which is part of their job) a right alliance can help improve things significantly. Find these who care and unite. It can be a project sponsor who cares, when project manager doesn't, or it can be project manager when team mates don't. It can be quality manager, a director, a fellow developer or business analyst or tester. The bad guys will back out or leave you alone to do the things right and then will definitely jump on the boat to collect the credits. Look at politicians, when they trying to achieve something first thing the do is forming a coalition. Unfortunately, when you told to “just get on with it” you’re already involved in politics whether you like the smell of it or not.
Find someone who has a significant stake in the project’s success or failure, in its quality and make them an ally.