As my answer is quite big I've highlighted the different regions I answer your question.
Intro and basic info
I take it you know how antibodies are made, but as a quick recap they're made by VDJ recombination of a limited but still quite numerous pool of genes which are recombined randomly, and then further recombination occurs by hypermutation of certain segments particularly in the regions that identify antigens.
What is Hypermutation?
Hypermutation occurs after the original antibody is made in order to perfect it. The same mechanism I talk about in moulding antigens below. It is exactly what it says: a high rate of mutation compared to that of the low rate in cells normally. When B cells are activated because they've met their antigen to which they respond (cognate antigen), they undergo somatic hypermutation. While the B cells undergo somatic hypermutation, the genes which code for the antibody are mutated so that the antibody binds to its cognate antigen with a different specificity. If it binds better the B cell gets to live, if it doesn't bind or it is worse then the B cell dies.
What we cannot do is the other way around. We can't recognise an antigen and then make an antibody to it, because recognising the antigen requires an antibody. What we can do is once we've recognised the antigen, then mould the antibody so it is a better fit. How we do this is by B cells mutating their antibodies and competing which binds better. However, B cells just don't have the knowledge to see an antigen and think a tyrosine residue at this position will be perfect to change my shape to this configuration - that's really complex stuff!
Do antibodies recognise every molecule?
Antibodies are made to essentially every antigen which is very costly in terms of energy as you mentioned. In fact, the number of genes that make antibodies are thought to be the perfect amount as to protect us without being too numerous so that it is not only too costly, but we have so many different antibodies the chance of ever finding the right B cell is so low we die before we manage. This is because of the way antibodies are mass produced, in the typical pathway of new antigens, firstly a T cell must recognise the antigen then B cells that produce an antibody that binds to the antigen (rarely in the same region, and may not even be to a protein antigen).
So these two paragraphs highlight the limitations and answer your first question. Antibodies are so diverse that we can expect quite a few to recognise every pathogen, but not every single possible antigen will have a cognate antibody. Diversity without so much diversity that it becomes redundant. The second limitation is that antibodies will ideally not form if they recognise self (our own proteins etc.) Which leads on to your next question.
What if a pathogen makes antigens that look like our own proteins?
Autoantibodies are made but are typically non-pathogenic (i.e., they don't cause harm). Certain HLA/MHC polymorphisms that make us likely to form autoreactive T cells, also make us make autoreactive antibodies. Interestingly, this increases our risk of autoimmune diabetes but ALSO makes us more resistant to infection by HIV. This can be practically seen in the DQ8 polymorphism. This is a perfect example to illustrate the answer to your second question. Ideally, pathogens which have antigens similar to our own would not be detected. HIV wraps itself with an envelope of our own lipid membrane for this purpose, and the best neutralising antibodies are often self-reactive and therefore are those that failed elimination.
However even these pathogens are going to do something or make something that isn't something our cells usually do. This is how the body finds and targets cancer cells (in a way), they do things our own cells won't typically do like make the wrong proteins or wrong amounts etc. Thus cancer cells and pathogens can be targeted by our cells that find something that isn't self (CD8 cytotoxic/killer T cells). As for pathogens, we all make MHC/HLA which is unique to us and pathogens could never manage to invade and make the specific HLA/MHC that we do, so our body also targets missing HLA/MHC.